package com.xiaodeng.xdblogspringboot.exception;



import com.xiaodeng.xdblogspringboot.pojo.Result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@AllArgsConstructor
@Data
public class UserException extends RuntimeException{
        private Integer code;//业务状态码  200-成功  500-失败
        private String message;//提示信息
        private Object data;//响应数据

    public UserException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public UserException(String message) {
        this.message = message;
    }

    public Result userexception() {
        return new Result(code, message, data);
    }



}
